﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RiderShop.Mobile.Common.Helper
{
    public class CacheViewsPath
    {
        private const string CacheKey = "View_{0}_{1}_{2}";
        private static Dictionary<string, string> cacheList = new Dictionary<string, string>();

        public static string GetViewPath(string theme, string controller, string view)
        {
            string key = string.Format(CacheKey, theme, controller, view);
            if (cacheList.ContainsKey(key))
            {
                return cacheList[key];
            }
            else
            {
                return string.Empty;
            }
        }

        public static void SetViewPath(string theme, string controller, string view, string path)
        {
            string key = string.Format(CacheKey, theme, controller, view);
            if (!cacheList.ContainsKey(key))
            {
                cacheList.Add(key, path);
            }
            else
            {
                cacheList[key] = path;
            }
        }
    }
}
